﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Surface
{
// voorbeeld Student class
    public class Student
    {
        private String naam;
        private int studentNummer;

        /*
         * constructor
         */
        public Student(String naam, int studentNummer)
        {
            this.naam = naam;
            this.studentNummer = studentNummer;
        }

        /*
         * implementation of CompareTo
         */
        public int CompareTo(object obj)
        {
            if (obj is Student)
            {
                Student that = (Student)obj;
                if (this.naam == (that.naam))
                {
                    return this.studentNummer.CompareTo(that.studentNummer);
                }
                return this.naam.CompareTo(that.naam);
            }
            else
            {
                throw new ArgumentException("Object is not of type Student");
            }
        }

        /*
         * ToString
         */
        public override string ToString()
        {
            return naam + ", " + studentNummer + "\n";
        }
    }
}
